#!/bin/bash

cygwin=false;
case "`uname`" in
  CYGWIN*) cygwin=true ;;
esac

DELTAQ_BIN="`which $0`"
if [[ -z "$DELTAQ_BIN" ]]
then
    DELTAQ_BIN="$0"
fi
while [[ -L "$DELTAQ_BIN" ]]
do
    DELTAQ_BIN="`readlink -f $DELTAQ_BIN`"
done
DELTAQ_HOME="`dirname \"$DELTAQ_BIN\"`"
DELTAQ_HOME="`cd \"$DELTAQ_HOME\" ; pwd`"

DELTAQ_CP=""
for jar in "$DELTAQ_HOME"/lib/*.jar
do
    DELTAQ_CP="$DELTAQ_CP:$jar"
done
DELTAQ_CP="${DELTAQ_CP#:}"

if $cygwin ; then
  DELTAQ_CP="`cygpath --windows --path \"$DELTAQ_CP\"`"
fi

DELTAQ_VM_OPTIONS[0]="-Dsun.io.useCanonCaches=false"
DELTAQ_VM_OPTIONS[1]="-Djava.util.logging.config.file=$DELTAQ_HOME/logging.properties"

DELTAQ_MAINCLASS=deltaq.DeltaQ
java "${DELTAQ_VM_OPTIONS[@]}" -cp "$DELTAQ_CP" $DELTAQ_MAINCLASS "$@"
